summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCharles Lombardo <clombardo169@gmail.com>2023-04-03 00:58:57 +0200
committerbunnei <bunneidev@gmail.com>2023-06-03 09:05:49 +0200
commit4816d5158eea13acc165dddbd8698c7ca8900a7d (patch)
tree9828878bd39cd294e621c7c30c1dfb15c309a75d
parentandroid: Remove unused dimensions files (diff)
downloadyuzu-4816d5158eea13acc165dddbd8698c7ca8900a7d.tar
yuzu-4816d5158eea13acc165dddbd8698c7ca8900a7d.tar.gz
yuzu-4816d5158eea13acc165dddbd8698c7ca8900a7d.tar.bz2
yuzu-4816d5158eea13acc165dddbd8698c7ca8900a7d.tar.lz
yuzu-4816d5158eea13acc165dddbd8698c7ca8900a7d.tar.xz
yuzu-4816d5158eea13acc165dddbd8698c7ca8900a7d.tar.zst
yuzu-4816d5158eea13acc165dddbd8698c7ca8900a7d.zip
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/adapters/GameAdapter.kt24
1 files changed, 9 insertions, 15 deletions
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/adapters/GameAdapter.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/adapters/GameAdapter.kt
index d4613fa8c..7a0969a55 100644
--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/adapters/GameAdapter.kt
+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/adapters/GameAdapter.kt
@@ -62,21 +62,6 @@ class GameAdapter(private val activity: AppCompatActivity) : RecyclerView.Adapte
override fun onBindViewHolder(holder: GameViewHolder, position: Int) {
if (isDatasetValid) {
if (cursor!!.moveToPosition(position)) {
- holder.binding.imageGameScreen.scaleType = ImageView.ScaleType.CENTER_CROP
- activity.lifecycleScope.launch {
- withContext(Dispatchers.IO) {
- val uri =
- Uri.parse(cursor!!.getString(GameDatabase.GAME_COLUMN_PATH)).toString()
- val bitmap = decodeGameIcon(uri)
- withContext(Dispatchers.Main) {
- holder.binding.imageGameScreen.load(bitmap) {
- error(R.drawable.no_icon)
- crossfade(true)
- }
- }
- }
- }
-
// TODO These shouldn't be necessary once the move to a DB-based model is complete.
val game = Game(
cursor!!.getString(GameDatabase.GAME_COLUMN_TITLE),
@@ -88,6 +73,15 @@ class GameAdapter(private val activity: AppCompatActivity) : RecyclerView.Adapte
)
holder.game = game
+ holder.binding.imageGameScreen.scaleType = ImageView.ScaleType.CENTER_CROP
+ activity.lifecycleScope.launch {
+ val bitmap = decodeGameIcon(game.path)
+ holder.binding.imageGameScreen.load(bitmap) {
+ error(R.drawable.no_icon)
+ crossfade(true)
+ }
+ }
+
holder.binding.textGameTitle.text = game.title.replace("[\\t\\n\\r]+".toRegex(), " ")
holder.binding.textGameCaption.text = game.company